<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>个人主页--我的草稿箱</title>
    <link rel="icon" href="./favicon/favicon.ico" type="image/x-icon">
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/bootstrap-icons/1.11.1/font/bootstrap-icons.min.css">
    <script src="js/bootstrap.bundle.min.js"></script>
</head>
<body class="container mt-4">
<h3 class="mb-4">我的草稿箱</h3>

<c:forEach items="${articles}" var="article">
    <div class="card mb-2">
        <div class="card-body d-flex justify-content-between align-items-center">
            <a href="articleServlet?method=draftDetail&id=${article.id}" class="fw-bold">${article.title}</a>
            <small class="text-muted">${article.createdAt}</small>
        </div>
    </div>
</c:forEach>

<c:if test="${empty articles}">
    <div class="text-center text-muted">暂无草稿</div>
</c:if>

<div class="mt-3">
    <a class="btn btn-outline-secondary" href="javascript:history.back()">返回</a>
</div>
</body>
</html>